package com.lxd.test.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
 * @Author Dongdong
 * @注释
 */
// 要调用的服务在nacos的名字
@FeignClient(value = "beacon-cache")
public interface cacheClient {
    @PostMapping(value = "/cache/set/{key}")
    public void set(@PathVariable(value = "key") String key, @RequestParam(value = "value") Object value);

    @PostMapping(value = "/cache/setlong/{key}")
    public void setLong(@PathVariable(value = "key") String key, @RequestParam(value = "value") Long value);

    @PostMapping(value = "/cache/hmset/{key}")
    public void hSet(@PathVariable(value = "key") String key,  @RequestBody Map<String,Object> value);
    //Map<String,Object>... value == List<Map<String,Object>>
    @PostMapping(value = "/cache/sadd/{key}")
    void sadd(@PathVariable(value = "key")String key, @RequestBody Map<String,Object>... maps);

    @GetMapping("/cacahe/hget/{key}")
    String hget(@PathVariable(value = "key") String key, @PathVariable(value = "field") String field);

    @PostMapping("/cache/pipeline/string")
    public void pipeline(@RequestBody Map<String,String> map);

    @PostMapping(value = "/cache/saddstr/{key}")
    public void saddStr(@PathVariable(value = "key")String key, @RequestBody String... value);
}
